<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/base.css">
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>
    <title>分销订单</title>
    <style>
        .wrap-fxhy .header select{
            border:none;
            font-size: 16px;
            font-family: '微软雅黑';
        }
        .wrap-fxhy .header select option{
            border:none;
        }
    </style>
{include file="public/href" /}
</head>
<body>
<div class="wrap-fxhy">
    <div class="header">
        <p>分销订单</p>
        <img src="__STATIC__/img/back.png" class="back" onclick = window.location.href="{:url('mobile/user_info/my_shop_index')}">
        <!--<div>-->
            <!--<select onchange="change_type()" id="type">-->
                <!--{volist name='statusList' id='item'}-->
                <!--<option value="{$key}" {if condition="input('type') eq $key"} selected {/if}>{$item}</option>-->
                <!--{/volist}-->
            <!--</select>-->
        <!--</div>-->
    </div>
    <div class="center" >
        <div class="cur" id="contentList">
        <!--订单列表容器-->
        </div>
    </div>
</div>
{include file="public/src" /}
<script>
    //改变状态
    function change_type(){
        var type = $('#type').val();
        window.location.href = "{:url('mobile/member_order/fx_order')}?type="+type;
    }
    //layer流加载
    layui.use('flow', function() {
        var $ = layui.jquery;
        var flow = layui.flow;
        var show = $('#show').val(); //当前浏览的类型
        var sort_type = $('#sort_type').val(); //当前排序的类型
        var search = $('#search').val();
        flow.load({
            elem: '#contentList' //流加载容器
            ,isAuto:true
            ,isLazyimg:true
            ,done: function(page, next){ //执行下一页的回调
                var lis = [];
                $.ajax({
                    url:"{:url('mobile/member_order/fx_order')}",
                    dataType:'json',
                    type:'post',
                    data:{'page':page,'type':"{:input('type',0)}"},
                    success:function(t){
                        layui.each(t.data, function(index, item){
                            var avatar = "__STATIC__/img_user/default_user.png";
                            var nickname = "未设置";
                            if (item.memberDistribution.member.avatar){
                                avatar = item.memberDistribution.member.avatar;
                                if (item.memberDistribution.member.avatar.indexOf('http') == -1){
                                    avatar = '/'+item.memberDistribution.member.avatar;
                                }
                            }
                            if (item.memberDistribution.member.nickname){
                                nickname = item.memberDistribution.member.nickname;
                            }

                            lis.push('<div>' +
                                        '<div class="time">订单时间：'+item.create_time+'<span>付款时间: '+item.memberOrderList.create_time.split(' ')[0]+'</span></div>' +
                                            '<div class="main" style="margin-bottom: 2%;margin-top: 0;">' +
                                                '<div class="left">' +
                                                '<img src="'+avatar+'" onerror=this.src="/static/mobile/img/empty_img.png" ><br>' +
                                                '<span><a href="#">'+nickname+'</a></span>' +
                                                '</div>' +
                                            '<div class="right">' +
                                            '<div class="content" id="content">' +
                                                '<p>金额：'+item.memberOrderList.total_price+'元</p>' +
                                                '<p>佣金：'+item.brokerage+'元</p>' +
                                            '</div>' +
                                            '</div>' +
                                        '</div>' +
                                    '</div>');
                        });
                        next(lis.join(''), page < t.pages);
                    }
                })
            }
        });
    });
</script>
</body>
</html>